/**
 * busProduct 产品管理
 * @methods	setProductAttrList 更新产品属性列表
 * @methods delProductAttrList 删除产品属性列表
 * @methods setProductCateRowList 更新产品分类列表
 */

import { defineStore } from 'pinia';

export const useBusProduct = defineStore('busProduct', {
	state: () => {
		return {
			productAttrList: [{ value: '',aValueId: [] }] as any,
			productCateRowList: [] as any
		}
	},
	actions: {
		setProductAttrList(data: any) {
			this.productAttrList.push(data);
		},
		delProductAttrList(index: number, num: number = 1) {
			this.productAttrList.splice(index, num);
		},
		setProductCateRowList(data: any) {
			this.productCateRowList.push(data);
		},
		delProductCateRowList(index: number, num: number = 1) {
			this.productCateRowList.splice(index, num);
		},
	},
});
